// app.ts
<<<<<<< HEAD
var utils = require('./utils/util.js')

App({
  globalData: {
    hello: 123,
    list: []
  },

  async initDataDeal() {
    var retData = []
    var that = this
    wx.request({
      url: 'http://todo.wingszeng.top:80/all',
      header: {
        "content-type": "application/x-www-form-urlencoded" // 默认值
      },
      method: "GET",
      success (res) {
        console.log(res.data.length)
        retData = res.data
        console.log('okkkkk',retData)
        for (let index = 0; index < retData.length; index++) {
          // 存储当前日期第一个
          let tempList = []
          tempList.push(retData[index])
          console.log('here')
          // 存储当前日期接下来的，默认拿到的数据按日期排序
          for(index; index < retData.length; index++) {
            if (retData[index].due_time != tempList[0].due_time) {
              // 到下一日期
              // 将当前日期推入列表
              that.globalData.list.push({
                due_time: tempList[0].due_time,
                childlist: tempList
              })
              // 清空列表 存储下一日期第一个
              tempList = []
              tempList.push(retData[index])
            }
            // 属于当前日期的任务
            tempList.push(retData[index])
          }
        }

        console.log(that.globalData.list)
      }
    })

=======
//var utils = require('./utils/util.js')

App({
  globalData: {
>>>>>>> f113db2e07add644c94f5cf5828e70d03057259a
  },

  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 从服务器获取数据
<<<<<<< HEAD
    this.initDataDeal()
=======
    //this.initDataDeal()
    // let that = this
    // wx.request({
    //   url: 'http://47.102.152.116:80/all',
    //   header: {
    //     "content-type": "application/x-www-form-urlencoded" // 默认值
    //   },
    //   method: "GET",
    //   success (res) {
    //     console.log(res.data.length)
    //     that.globalData.list = res.data
    //     console.log("list",that.globalData.list)
    //     that.globalData.employemploy = true;
    //     if (that.employCallback) {
    //       that.employCallback(true);
    //     }
    //    },
    // })
>>>>>>> f113db2e07add644c94f5cf5828e70d03057259a

    // 登录
    wx.login({
      success: res => {
        console.log(res.code)
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      },
    })
  },
})


<<<<<<< HEAD
function getAll(){
  var ret = []
  wx.request({
    url: 'http://todo.wingszeng.top:80/all',
    header: {
      "content-type": "application/x-www-form-urlencoded" // 默认值
    },
    method: "GET",
    success (res) {
      console.log(res.data.length)
      ret = res.data
    }
  })
}
=======
// function getAll(){
//   let ret = []
//   wx.request({
//     url: 'http://47.102.152.116:80/all',
//     header: {
//       "content-type": "application/x-www-form-urlencoded" // 默认值
//     },
//     method: "GET",
//     success (res) {
//       console.log(res.data.length)
//       ret = res.data
//     }
//   })
//}
>>>>>>> f113db2e07add644c94f5cf5828e70d03057259a
